package com.shuiqinling.ww.android.cn00.wxapi;


import android.app.Activity;

import com.shuiqinling.ww.android.Constansts;
import com.tencent.mm.sdk.modelmsg.SendAuth;
import com.tencent.mm.sdk.modelpay.PayReq;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

public class WeChat {

	public static IWXAPI api;

	public static void init(Activity ctx) {
		api = WXAPIFactory.createWXAPI(ctx, Constansts.WX_APP_ID);
		api.registerApp(Constansts.WX_APP_ID);
	}

	public static void pay(PayReq req) {
		api.sendReq(req);
	}
	
	public static void login(){
	    final SendAuth.Req req = new SendAuth.Req();
	    req.scope = "snsapi_userinfo";
	    req.state = "witchweapon";
	    api.sendReq(req);
	}

}
